package lab1;

public class Program {

	public static void main(String[] args) {
		
		NString str = new NString("abracadabra");
		
		String str2 = new String ("str2a");
		
		
		System.out.println(str2);
		str.setString(str2);
		System.out.println(str.getString());
		str2.toUpperCase();
		System.out.println(str.getString());
		
	
		//test prefix
		System.out.println("a is prefix of abracadabra: " + (str.isPrefix("a")? "true" : "false" ));
		System.out.println("abr is prefix of abracadabra: " + (str.isPrefix("abr")? "true" : "false" ));
		System.out.println("bar is prefix of abracadabra: " + (str.isPrefix("bar")? "true" : "false" ));
		System.out.println("abracadabra is prefix of abracadabra: " + (str.isPrefix("abracadabra")? "true" : "false" ));
		System.out.println();
		
		//test suffix
		System.out.println("a is suffix of abracadabra: " + (str.isSuffix("a")? "true" : "false" ));
		System.out.println("bra is suffix of abracadabra: " + (str.isSuffix("bra")? "true" : "false" ));
		System.out.println("bro is suffix of abracadabra: " + (str.isSuffix("bro")? "true" : "false" ));
		System.out.println("abracadabra is suffix of abracadabra: " + (str.isSuffix("abracadabra")? "true" : "false" ));
		System.out.println();
		
		//test substr
		System.out.println("a is substring of abracadabra: " + (str.isSubstring("a")? "true" : "false" ));
		System.out.println("rac is substring of abracadabra: " + (str.isSubstring("rac")? "true" : "false" ));
		System.out.println("dabra is substring of abracadabra: " + (str.isSubstring("dabra")? "true" : "false" ));
		System.out.println("cobra is substring of abracadabra: " + (str.isSubstring("cobra")? "true" : "false" ));
		System.out.println("abracadabra is substring of abracadabra: " + (str.isSubstring("abracadabra")? "true" : "false" ));
		System.out.println();
		
	}
}
